# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/15 17:22
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('QLCDNumber学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		lcd=QLCDNumber(self)
		# lcd=QLCDNumber(5,self)

		lcd.setDigitCount(2)
		lcd.move(0,0)
		lcd.resize(300,100)

		# lcd.display(": '")
		# lcd.setMode(QLCDNumber.Bin)
		# lcd.setMode(QLCDNumber.Oct)
		# lcd.setMode(QLCDNumber.Hex)
		# lcd.setHexMode()
		print(lcd.checkOverflow(99))
		print(lcd.checkOverflow(100))

		lcd.overflow.connect(lambda :print('数值溢出'))
		lcd.display(99)

		lcd2 = QLCDNumber(self)
		lcd2.move(0,100)
		lcd2.resize(300,100)
		lcd2.display(99)

		lcd3 = QLCDNumber(self)
		lcd3.move(0,200)
		lcd3.resize(300,100)
		lcd3.display(99)


		lcd.setSegmentStyle(QLCDNumber.Outline)
		lcd2.setSegmentStyle(QLCDNumber.Filled)
		lcd3.setSegmentStyle(QLCDNumber.Flat)



		# btn=QPushButton(self)
		# btn.setText('按钮')
		# btn.move(50,50)
		# # btn.clicked.connect(lambda :print(lcd.value()))
		# btn.clicked.connect(lambda :print(lcd.intValue()))



if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())